import * as _ from 'lodash'
/**
 * 搜索结果对象
 */
export interface SearchResult{
    L:any,
    P:number,
    N:number,
    T:number,
    R:any
}
/**
 * 搜索条件对象
 */
export interface SearchWehre{
    Keyword?:string,
    W?:any,
    P?:number,
    N?:number
}
/**
 * 对象State接口
 */
export interface ObjectState{
    Where:SearchWehre,
    Result:SearchResult,
    AddData:any,
    EditData:any,
    ShowAddModal?:boolean,
    ShowEditModal?:boolean,
}
const DefaultSearchWehre:SearchWehre={
    Keyword:'',
    W:{},
    P:1,
    N:10
}
const DefaultSearchResult:SearchResult = {
    L:[],
    P:1,
    N:10,
    T:0,
    R:{}
}
export function clone(Obj:any):any{
    return _.cloneDeep(Obj)
}
const DefaultObjectState:ObjectState={
    Where:clone(DefaultSearchWehre),
    Result:clone(DefaultSearchResult),
    AddData:{},
    EditData:{},
}
export {
    DefaultObjectState,DefaultSearchResult,DefaultSearchWehre
}
